package com.md24housecall.model;

import com.md24housecall.activity.R;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;

public class TermsAndConditions {
	private Context mConText;
	private AlertDialog.Builder mBuilder;
	private AlertDialog alertDialog;

	public TermsAndConditions(Context context) {
		mConText = context;
	}

	public boolean isShow(){
		return alertDialog.isShowing();
	}
	public void show() {
		String title = mConText.getString(R.string.title_terms_and_condition);
		String message = mConText
				.getString(R.string.content_terms_and_condition);
		if (mBuilder == null) {
			mBuilder = new AlertDialog.Builder(mConText)
					.setTitle(title)
					.setMessage(message)
					.setPositiveButton(android.R.string.ok,
							new Dialog.OnClickListener() {

								@Override
								public void onClick(
										DialogInterface dialogInterface, int i) {
									// Mark this version as read.
									dialogInterface.dismiss();
								}
							});
			alertDialog=mBuilder.create();
		}
		if(isShow())
			alertDialog.dismiss();
		alertDialog.show();
	}
}
